package com.efuture.filter;

import jakarta.servlet.*;
import java.io.IOException;

/**
 * @description: Filter快速入门
 * @author zhaoshanshan
 * @date 2021/10/4 8:25 下午
 * @version 1.0
 */
//@WebFilter("/*")//需要拦截的jsp
public class FilterQuickStart implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        Filter.super.init(filterConfig);
    }


    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        //此方法进行过滤操作
        System.out.println("我可以对Servlet进行过滤操作");
        //放行
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {
        Filter.super.destroy();
    }
}
